

<!DOCTYPE HTML>
<html>
<head>
<title>更改密码</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="监控系统 Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
    Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<link href="/static/css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<!-- Custom Theme files -->

<link href="/static/css/style.css" rel='stylesheet' type='text/css' />
<link href="/static/css/font-awesome.css" rel="stylesheet"> 
<script src="/static/js/jquery.min.js"> </script>
<script src="/static/js/bootstrap.min.js"> </script>
    <script type="text/javascript">
     function func(){
            return false;
        }
        $(function () {
            $('#change_submit').click(function(){
            var $count = $('#count').val();
            var $old_pwd = $('#old_pwd').val();
            var $new_pwd = $('#new_pwd').val();
            var $new_pwd1 = $('#new_pwd1').val();
            if ($new_pwd == $new_pwd1){
                    $.ajax({
                   'url':'/ajax_signin_user_handle',
                   'type':'post',
                   'dataType':'json',
                   'data':{'count':$count,'pwd':$old_pwd}
               }).success(function (data) {
                   if (data.res == '0'){
                       alert('原用户名或密码错误，请重新输入')
                   }
                   else{
                       $.ajax({
                           'url':'/ajax_change_pwd',
                           'type':'post',
                           'dataType':'json',
                           'data':{'count':$count,'pwd':$new_pwd}
                       }).success(function(data){
                           if (data.res == '0'){
                               alert("密码修改失败")
                           }else {
                               alert("成功修改密码")
                           }
                       });
                   }
              });
            }else{
                alert('两次输入的新密码不同')
            }
        });})


</script>
</head>
<body>
	<div class="login">
		<h1><a href="index.html">监控系统 </a></h1>
		<div class="login-bottom">
			<h2>更改密码</h2>
            <form action="" onsubmit="return func()">
			<div class="col-md-6">

				<div class="login-mail">
					<input type="text" placeholder="账号" required="" id="count">
					<i class="fa fa-envelope"></i>
				</div>
				<div class="login-mail">
					<input type="password" placeholder="旧密码" required="" id = 'old_pwd'>
					<i class="fa fa-lock"></i>
				</div>
				<div class="login-mail">
					<input type="password" placeholder="新密码" required="" id ='new_pwd'>
					<i class="fa fa-lock"></i>
				</div>
                <div class="login-mail">
					<input type="password" placeholder="再次输入新密码" required="" id="new_pwd1">
					<i class="fa fa-lock"></i>
				</div>
				  <a class="news-letter" href="#">
						 <label class="checkbox1"><input type="checkbox" name="checkbox" ><i> </i>我同意用戶协议</label>
					   </a>
	
			</div>
			<div class="col-md-6 login-do">
				<label class="hvr-shutter-in-horizontal login-sub">
					<input type="submit" id="change_submit"  value="提交">
					</label>
					<p>已经更改过了</p>
				<a href="signin.html" class="hvr-shutter-in-horizontal">登陆</a>
			</div>
            </form>
			<div class="clearfix"> </div>
		</div>
	</div>
		<!---->

<!---->
<!--scrolling js-->
	<script src="/static/js/jquery.nicescroll.js"></script>
	<script src="/static/js/scripts.js"></script>
	<!--//scrolling js-->
</body>
</html>

